<!DOCTYPE html>
<html>
	<head>
		<title>UtilsColor.js - Documentation</title>
		<script type="text/javascript" src="../../CodeFormater/src/CodeFormater.js"></script>
		<script type="text/javascript">
			window.addEventListener("load", init, false);

			function init()
			{
				document.querySelectorAll("pre").forEach(M4SynthaxColor.of);

			}

			/**
			 * CHEAT OMG
			 */
			NodeList.prototype.forEach = Array.prototype.forEach;
		</script>
		<link href="../../common/docs/docs.css" type="text/css" rel="stylesheet"/>
	</head>
	<body>
		<h1>ColorUtils.js</h1>
		<hr>
		<h2>Introduction</h2>
		<p>
			Require <a href="../../M4/docs/">M4.js</a>
		</p>
		<h2>Code Samples</h2>
		<h3>The basics</h3>
		<p>
			Simple implementation for HSL &lt;-&gt; RGB color converter.
		</p>
		<pre>
var red = 255;
var green = 0;
var blue = 0;
var alpha = 1;

/**
 * Constructor from RGBA values
 **/
var color = new HSLColor(red, green, blue, alpha);

/**
 * Output : rgb(255, 0, 0)
 **/
console.log(color.getRGB());

/**
 * Output : rgba(255, 0, 0, 1)
 **/
console.log(color.getRGBA());

/**
 * Set Hue to 180 degree
 **/
color.setH(180);

/**
 * Set Saturation to 100 percent
 **/
color.setS(1);

/**
 * Set luminance to 50 percent
 **/
color.setL(0.5);</pre>
		<footer>
			&copy; arno06@gmail.com 2013
		</footer>
	</body>
</html>